<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>备份还原数据库</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" href="../css/bootstrap.css" />
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<link href="../css/animate.css" rel="stylesheet">
<link href="../css/style.css" rel="stylesheet">
<link href="../fonts/css/font-awesome.css" rel="stylesheet">
<link rel="stylesheet" href="../css/sweetalert.css" />
<script src="../js/jquery.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/jquery.metisMenu.js"></script>
<script src="../js/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="../js/sweetalert.min.js"></script>
<!-- Custom and plugin javascript -->
<script src="../js/inspinia.js"></script>
<script src="../js/pace.min.js"></script>
</head>

<body>
	<div id="wrapper">
		<!--左侧导航栏-->
		<nav class="navbar-default navbar-static-side" role="navigation">
		<div class="sidebar-collapse">
			<ul class="nav metismenu" id="side-menu">
				<li><a href="#"><i class="fa fa-th-large"></i> <span
						class="nav-label">发帖管理</span> <span class="fa arrow"></span></a>
					<ul class="nav nav-second-level collapse">
						<li><a href="findingadmin.jsp">寻帖审核</a></li>
						<li><a href="main.jsp">失物审核</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-th-large"></i> <span
						class="nav-label">信息管理</span> <span class="fa arrow"></span></a>
					<ul class="nav nav-second-level collapse">
						<li><a href="locationadmin.jsp">招领点管理</a></li>
						<li><a href="charts.jsp">图表展示</a></li>
					</ul></li>
				<li><a href="#"><i class="fa fa-th-large"></i> <span
						class="nav-label">管理</span> <span class="fa arrow"></span></a>
					<ul class="nav nav-second-level collapse">
						<li><a href="editor.jsp">发布公告</a></li>
						<li><a href="data.jsp">数据备份</a></li>
					</ul></li>
			</ul>

		</div>
		</nav>
		<!--
            	作者：1462859532@qq.com
            	时间：2017-03-29
            	描述：右侧导航栏
            -->
		<div id="page-wrapper" class="gray-bg">
			<div class="row border-bottom">
				<nav class="navbar navbar-static-top" role="navigation"
					style="margin-bottom: 0">
				<div class="navbar-header">
					<a class="navbar-minimalize minimalize-styl-2 btn btn-primary "
						href="#"><i class="fa fa-bars"></i> </a>
				</div>
				<ul class="nav navbar-top-links navbar-right">
					<li><span class="m-r-sm text-muted welcome-message">欢迎来到系统管理员</span>
					</li>
					<li><a href="login.jsp"> <i class="fa fa-sign-out"></i> 注销
					</a></li>
				</ul>
				</nav>
			</div>
			<div class="row wrapper border-bottom white-bg page-heading">
				<div class="col-lg-10">
					<ol class="breadcrumb">
						<li><a>信息管理</a></li>
						<li class="active"><strong>数据备份</strong></li>
					</ol>
				</div>
			</div>
			<div class="wrapper wrapper-content  animated fadeInRight article">
				<div class="row">
					<div class="row wrapper wrapper-content animated fadeInRight">
						<br />
						<div class="col-sm-12">
							<div class="ibox float-e-margins">
								<div class="ibox-content">
									<button style="font-size: 100px;"
										class="btn btn-success  dim restore" type="button">
										<i class="fa fa-upload">备份</i>
									</button>
									
								</div>
							</div>
						</div>
					</div>
				</div>

			</div>
		</div>
	</div>
<div>
	<div class="modal fade" id="modeladd" tabindex="-1" role="dialog">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-label="Close">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title">备份路径</h4>
				</div>
				<div class="modal-body">
					<div class="form-group">
						<!--
                                	作者：1462859532@qq.com
                                	时间：2017-03-28
                                	描述：可以在上面做个表单验证
                                -->
						<label for="locname" class="control-label">路径(例如"C:\\test.sql")</label> 
						<div class="col-sm-12">
									<input type="name" class="form-control" id="datapath" placeholder="" >
								</div>
					</div>
					
					
				</div>
				<div class="modal-footer">

					<button type="button" class="btn btn-default" id="addclose"
						data-dismiss="modal">关闭</button>
					<button type="button" class="btn btn-primary" id="sure"
						data-dismiss="modal">确定</button>
				</div>
			</div>
		</div>
	</div>
</div>
	<script>
	   $(function(){
		   $('.restore').click(function(){
			   $("#modeladd").modal('show');
			  // alert($("#datapath").val());
		   })
		   
		   $("#sure").click(function(){
			   var path=$("#datapath").val();
			   //alert($("#datapath").val());
			   $.ajax({
				   type:"post",
				   url:"../admin/datarestore.action?filepath="+path,
				   dataType:"json",
				   success:function(data){
					   swal("成功","备份成功","success");
				   },
				   error:function(){
					   swal("失败","备份失败","error");
				   }
			   })
		   })
		   
		  
	   })
	   
	
	</script>
	<script src="../js/plugins/sweetalert/sweetalert.min.js">
    </script>
</body>
</html>